﻿@model b7.Models.NhomSanpham

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_LayoutManager.cshtml";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="../../Scripts/ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="../../Scripts/ckfinder/ckfinder.js" type="text/javascript"></script>
<script type="text/javascript">
    function BrowseServer() {
        var finder = new CKFinder();
        finder.basePath = '../';
        finder.selectActionFunction = SetFileField;
        finder.popup();
    }
    function SetFileField(fileUrl) {
        document.getElementById('Anh').value = fileUrl;
    }
</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>NhomSanpham</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Anh)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Anh)
            @Html.ValidationMessageFor(model => model.Anh)
            <input type="button" value="Chọn Ảnh ..." onclick="BrowseServer();"/>
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
